@extends('admin.layouts.index')
@section('title', '用户信息更新')

@section('content')

<div class="row">
    <div class="col-md-12">
        <form method="POST" action="{{ URL::current() }}" id="usersUpdateForm">
            <div class="m-card">
                <div class="m-card-header header-bottom">用户信息更新</div>
                @if(Auth::user()->authority == 3)
                <div class="m-form-item">
                    <label>用户账号:</label>
                    <div class="m-col-3">
                        <input type="text" class="m-input" name="username" value="{{ $users->username }}" placeholder="请输入用户账号">
                    </div>
                </div>
                @endif
                <div class="m-form-item">
                    <label><b>*</b>账号头像:</label>
                    <div>
                        <a href="javascript:;" class="m-file" style="float:left;margin-left: 0px;">
                            <font>上传</font>
                            <input type="file" name="upload_avatar" id="upload_avatar" onchange="jsUpload('avatar',1024,true,{})">
                        </a>
                        <img src="{{ $users->avatar }}" class="m-file-image" id="avatar_show" style="max-width: 300px;">
                        <input type="hidden" name="avatar" id="avatar" value="{{ $users->avatar }}">
                    </div>
                </div>
                <div class="m-form-item">
                    <label><b>*</b>账号昵称:</label>
                    <div class="m-col-2 m-xs-12">
                        <input type="text" class="m-input" name="nike" id="nike" value="{{ $users->nike }}" placeholder="请输入账号昵称" maxlength="10">
                    </div>
                    @csrf
                </div>
                <div class="m-form-item">
                    <label><b>*</b>邮箱:<font>用于接收通知以及数据</font></label>
                    <div class="m-col-4 m-xs-12">
                        <input type="text" class="m-input" name="email" id="email" value="{{ $userInfo->email }}" placeholder="请输入邮箱号码" maxlength="35">
                    </div>
                </div>
                <div class="m-form-item">
                    <label>微信号:<font>方便紧急情况与您联系</font></label>
                    <div class="m-col-2 m-xs-12">
                        <input type="text" class="m-input" name="wechat" value="{{ $userInfo->wechat }}" placeholder="请输入微信号" maxlength="35">
                    </div>
                </div>
                @if(Auth::user()->authority == 3)
                <div class="m-form-item">
                    <label><b>*</b>用户账号余额:<font>管理员可见</font></label>
                    <div class="m-col-2">
                        <input type="text" class="m-input" name="money" value="{{ $users->money }}" placeholder="请输入账户余额">
                    </div>
                </div>
                <div class="m-form-item">
                    <label><b>*</b>用户禁用状态:<font>管理员可见</font></label>
                    <div class="m-col-2">
                        <select class="m-select" name="disable">
                            <option value="1" @if($users->disable == 1) selected @endif>正常状态</option>
                            <option value="2" @if($users->disable == 2) selected @endif>禁用状态</option>
                        </select>
                    </div>
                </div>
                <div class="m-form-item">
                    <label><b>*</b>用户权限:<font>管理员可见</font></label>
                    <div class="m-col-2">
                        <select class="m-select" name="authority">
                            <option value="1" @if($users->authority == 1) selected @endif>普通用户</option>
                            <option value="2" @if($users->authority == 2) selected @endif>代理商</option>
                            <option value="3" @if($users->authority == 2) selected @endif>超级管理</option>
                        </select>
                    </div>
                </div>
                <div class="m-form-item">
                    <label>用户来源:<font>管理员可见</font></label>
                    <div class="m-col-3">
                        <input type="text" class="m-input" name="comefrom" value="{{ $userInfo->comefrom }}" placeholder="请输入用户来源" maxlength="35">
                    </div>
                </div>
                <div class="m-form-item">
                    <label>用户备注:<font>管理员可见</font></label>
                    <textarea class="m-textarea" name="remark" placeholder="请输入用户备注" rows="5" maxlength="255">{{ $userInfo->remark }}</textarea>
                </div>
                @endif

                <div class="m-form-item">
                    <div class="m-form-btn" onclick="updateUsersInfo();">立即更新</div>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript" src="https://file.wailian1.cn/admin/assets/admin/js/public/image.upload.min.js"></script>
<script type="text/javascript" src="https://file.wailian1.cn/admin/assets/admin/js/libs/image-conversion/conversion.js"></script>
<script type="text/javascript" src="/assets/admin/js/dev/users.setting.876512.js"></script>
@endsection
